﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using DataModel;
using System.Web.UI.HtmlControls;

public partial class Guest_Help : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string control = string.Empty;
        using (DefaultEntityConnection connection = new DefaultEntityConnection())
        {
            foreach (Help help in connection.Helps)
            {         
                control += string.Format(@"<h2 class=""top-1 p3"">{0}</h2>
                                           <div class=""wrap"" dir=""rtl"">                        
                                              <img src=""{1}"" alt="""" class=""img-border img-indent""/>
                                              <div class=""extra-wrap"">
                                                 <p class=""color-1 p6"">{2}</p>
                                                 <a href=""{3}"" class=""button"">بیشتر بخوانید</a>
                                              </div>                        
                                            </div>", help.HelpTitle, string.Format("../Images/Help/{0}", help.ImageUrl), help.Description, string.Format("../Files/Help/{0}", help.FileUrl));
            }
        }            
        if (control != string.Empty)
        {
            HtmlGenericControl div = new HtmlGenericControl();
            div.ID = "body1";
            div.InnerHtml = control;
            helpDiv.Controls.Add(div);
        }
    }
}